﻿@model   Inovout.Cloud.DatabaseCluster.Models.Database
<div class="w-1">
    <div class="wgt">
        <div class="w-1-6">
            @Html.Partial("_Navigation", (object)ViewBag.Project)
        </div>
        <div class="w-5-6">
            <div class="wgt">
                <div class="w-1">
                    <table class="configTable w45">
                        <thead>
                            <tr>
                                <th class="w15">数据库</th>
                                <th class="w15">驱动类型</th>
                                <th class="w15">客户端</th>
                            </tr>
                        </thead>
                        <tbody>
                            @{
                                foreach (var item in ViewBag.DatabaseList)
                                {
                                    var enumType = typeof(Inovout.Cloud.DatabaseCluster.Service.DriveType);
                                    var DriveName = Enum.GetName(enumType, Convert.ToInt16(item.Driver));
                                <tr>
                                    <td>@item.Name</td>
                                    <td>@DriveName</td>
                                    <td><a href='@Url.Action("DownFile", "Database", new { fileName = "Views.zip" })'>下载</a></td>
                                </tr> 
                                }
                            }
                        </tbody>
                    </table>
                </div>
                <div class="w15 space spaceform">
                    <form action='@Url.Action("Save", "Database", new { projectId = ViewBag.Project.Id })' method="post">
                        <div class="namediv">
                            <label>
                                数据库名:
                                @Html.TextBoxFor(model => model.Name, new { @class = "w-1-2",@required="required", @maxlength="12"})
                            </label>
                        </div>
                        <div>
                            <label>
                                驱动类型:
                                    @Html.DropDownListFor(m => m.Driver, (List<SelectListItem>)ViewBag.SelectList, new { @class = "w-1-2"})     
                            </label>
                        </div>
                        <div>
                            <input type="submit" value="保存" />
                        </div>
                    </form>
                </div>
                <div class="w18 space">
                    <div id="decribebkcolor">
                        <span>请为您的项目创建数据库</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
